package edu.uclmgmu.bacteriosec.aspects.com.mysql.jdbc.ResultSet.getInt;

//import com.mysql.jdbc.ResultSet;

import edu.uclmgmu.bacteriosec.aspects.common.FilesStore;
import com.mysql.jdbc.ResultSet;
import java.sql.*;

privileged aspect ResultSet_CountCalls {
	private String testMethod;
	
	before() : !within(ResultSet_CountCalls) &&
						execution(public void *..test*(..)) {
		this.testMethod=thisJoinPointStaticPart.getSignature().toString();
	}

	after() : !within(ResultSet_CountCalls) &&
						execution(public void *..test*(..)) {
		this.testMethod=null;
	}

	int around(java.sql.ResultSet caller, int col) : target(caller) && args(col) && 
			call(* java.sql.ResultSet.getInt(int)) && !call(* com.mysql.jdbc.ResultSet.getInt(int)) &&
			!cflow(within(ResultSet_CountCalls)) && !within(edu.uclmgmu.bacteriosec.aspects.common.FilesStore) {
		FilesStore.updateNumberOfCalls(thisJoinPointStaticPart.getSignature().toString(), this.testMethod);
		return proceed(caller, col);
	}


/*	
	boolean around(com.mysql.jdbc.ResultSet caller) : target(caller) && 
		call(boolean com.mysql.jdbc.ResultSet.reallyResult()) && !call(* com.mysql.jdbc.ResultSet.getInt(int)) {
		FilesStore.updateNumberOfCalls(thisJoinPointStaticPart.getSignature().toString());
		return proceed(caller);
	}*/	


}
